package edu.ccut.saturn.manager.bundles.core;

import java.util.HashMap;
import java.util.Map;

import edu.ccut.saturn.component.ComponentManager;
import edu.ccut.saturn.component.DefaultComponent;
import edu.ccut.saturn.component.IComponentInfo;
import edu.ccut.saturn.component.IParameterContext;

public class QueryGraphicInfoByFullKey extends DefaultComponent {
	@Override
	public void execute(IParameterContext parameterContext) throws Exception {
		String fullKey = parameterContext.getParameterValue(0).toString();

		ComponentManager componentManager = ComponentManager.getInstance();
		IComponentInfo logicInfo = (IComponentInfo) componentManager
				.getComponentInfo(fullKey);
		ComponentGraphicInfoManager componentGraphicInfoManager = new ComponentGraphicInfoManager(logicInfo);

		Map<String, Object> infoMap = new HashMap<String, Object>();
		infoMap = componentGraphicInfoManager.getComponentGraphicInfoMap();

		parameterContext.setParameter(1, infoMap);
	}
}